<?php

/**
 * SocialMediaAccount form base class.
 *
 * @package    form
 * @subpackage social_media_account
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseSocialMediaAccountForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'           => new sfWidgetFormInputHidden(),
      'website'      => new sfWidgetFormChoice(array('choices' => array('facebook' => 'facebook', 'friendster' => 'friendster', 'multiply' => 'multiply', 'flickr' => 'flickr'))),
      'account_name' => new sfWidgetFormInput(),
      'person_id'    => new sfWidgetFormDoctrineChoice(array('model' => 'Person', 'add_empty' => true)),
      'client_id'    => new sfWidgetFormDoctrineChoice(array('model' => 'Client', 'add_empty' => true)),
      'created_at'   => new sfWidgetFormDateTime(),
      'updated_at'   => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'           => new sfValidatorDoctrineChoice(array('model' => 'SocialMediaAccount', 'column' => 'id', 'required' => false)),
      'website'      => new sfValidatorChoice(array('choices' => array('facebook' => 'facebook', 'friendster' => 'friendster', 'multiply' => 'multiply', 'flickr' => 'flickr'), 'required' => false)),
      'account_name' => new sfValidatorString(array('max_length' => 255)),
      'person_id'    => new sfValidatorDoctrineChoice(array('model' => 'Person', 'required' => false)),
      'client_id'    => new sfValidatorDoctrineChoice(array('model' => 'Client', 'required' => false)),
      'created_at'   => new sfValidatorDateTime(array('required' => false)),
      'updated_at'   => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('social_media_account[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'SocialMediaAccount';
  }

}
